package cz.muni.fi.pa165.musiclibrary.implejb.service.dto;

import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.joda.time.LocalDate;

import cz.muni.fi.pa165.musiclibrary.api.service.dto.IAlbumDTO;

/**
*
* @author Radoslav Stefanik 
* 2012-10-28T16:06:31+0100
*/
public final class AlbumDTO implements IAlbumDTO {

    private Long idAlbum;
    
    private String title;
    
    private LocalDate releaseDate;
    
    private byte[] albumArt;
    
    @Override
    public Long getIdAlbum() {
        return idAlbum;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public LocalDate getReleaseDate() {
        return releaseDate;
    }

    @Override
    public byte[] getAlbumArt() {
        return albumArt;
    }

    @Override
    public void setIdAlbum(Long idAlbum) {
        this.idAlbum = idAlbum;
    }

    @Override
    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public void setReleaseDate(LocalDate releaseDate) {
        this.releaseDate = releaseDate;
    }

    @Override
    public void setAlbumArt(byte[] albumArt) {
        this.albumArt = albumArt;
    }

    @Override
    public int hashCode() {
         return new HashCodeBuilder()//
                .append(this.getIdAlbum())//
                .build();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AlbumDTO other = (AlbumDTO) obj;
        return other.getIdAlbum() == this.getIdAlbum();
    }

    
}